/**
 * 
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 *   
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 * 
 */
package org.jiopi.ibean.kernel.remote;

import java.net.URI;

import org.jiopi.framework.FrameworkInitializer;
import org.jiopi.framework.CentralConsole;
import org.jiopi.framework.ControlPanel;
import org.jiopi.framework.ModuleConsole;
import org.junit.BeforeClass;
import org.junit.Test;

public class RemoteCentralConsoleTestCase {
	
	@BeforeClass public static void init(){
		FrameworkInitializer.initialize();
	}
	
	@Test public void RemoteModuleTest() throws Exception{
		ModuleConsole remoteModule = CentralConsole.accessModuleConsole("remote://ibean.remote.rmi@local/example.module.helloworld");
		//ModuleConsole localModule = CentralConsole.accessModuleConsole("example.module.helloworld");
		remoteModule.accessControlPanel("example.helloworld", ControlPanel.class).operate("sayHelloWorld", void.class);
		//localModule.accessControlPanel("example.helloworld", ControlPanel.class).operate("sayHelloWorld", void.class);
		
//		URI uri = new URI("remote://ibean.remote.rmi@127.0.0.1/example.module.helloworld");
//		System.out.println("getScheme:"+uri.getScheme());
//		System.out.println("getUserInfo:"+uri.getUserInfo());
//		System.out.println("getAuthority:"+uri.getAuthority());
//		System.out.println("getHost:"+uri.getHost());
//		System.out.println("getPath:"+uri.getPath());
//		
//		System.out.println("getRawUserInfo:"+uri.getRawUserInfo());
//		System.out.println("getRawAuthority:"+uri.getRawAuthority());
//		System.out.println("getRawAuthority:"+uri.getRawAuthority());
//		System.out.println("getRawPath:"+uri.getRawPath());
	}
	
	@Test public void tempTest(){
		ModuleConsole localModule = CentralConsole.accessModuleConsole("ibean.remote.rmi");
		localModule.accessControlPanel("jiopi.RemoteCentralConsole?local", null);
	}
	
	

}
